#ifndef DATABASE_FILE_H
#define DATABASE_FILE_H
/*

*/

extern "C"
{
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
}

#include <string>

#define BLOCK_SIZE 16384


namespace Database
{

class File
{
public:
	File(const char * const pathname);
	virtual ~File();

	bool isOpen() const;
	void close();
	int read(const off_t offset, const size_t count, void * const buf);
	int write(const off_t offset, const size_t count, const void * const buf);

	void incRef();
	void decRef();

private:
	std::string pathname_;
	int fd_;
	int refs_;
};

}	// namespace Database

#endif

